

class animal {
    public int age;
    public String name;

    public animal(int age, String name) {
        this.age = age;
        this.name = name;
    }
}
class Cat extends animal {
    public int age;
    {
        age = 10;
    }

    public Cat(int age, String name, int age1) {
        super(age, name);
        this.age = age1;
    }

    public void mmm() {
        System.out.println(this.name + "喵喵喵");
    }
    public void eat() {
        System.out.println(this.name + "吃猫粮");
    }
}
class Dog extends animal {
    public String color;

    public Dog(int age, String name,String color) {
        super(age, name);
        this.color = color;
    }

    public void www() {
        System.out.println(this.name + "汪汪汪");
    }
    public void eat() {
        System.out.println(this.name + "吃狗粮");
    }

}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog(12,"旺财","blue");
       // dog.name = "旺财";
        dog.www();

        Cat cat = new Cat(13,"小白",15);
       // cat.name = "小白";
        cat.eat();


    }
}
/*class animals {
    public String name;
    public int age;
    public int weight;

    public animals(String name, int age, int weight) {
        this.name = name;
        this.age = age;
        this.weight = weight;
    }
}
class cat extends animals{
    public  String color;

    public cat(String name, int age, int weight, String color) {
        super(name, age, weight);
        this.color = color;
    }

    public void mmm() {
        System.out.println(super.name + "喵喵喵");
    }
}
class dog extends animals {
    public String colo;



    public dog(String name, int age, int weight, String colo) {
        super(name, age, weight);
        this.colo = colo;
    }

    public void www() {
        System.out.println(super.name + "汪汪汪");
    }


}
public class Test {
    public static void main(String[] args) {
        dog dog1  = new dog("hh",12,13,"blue");

    }
}*/
/*import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            int z = scanner.nextInt();
            Sub sub = new Sub(x, y, z);
            System.out.println(sub.calculate());
        }
    }
}

class Base {

    private int x;
    private int y;

    public Base(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }
}
class Sub extends Base {
    private int z;
    public Sub(int x, int y, int z) {
        super(x, y);
        this.z = z;
        //write your code here
    }
    public int getZ() {
        return z;
    }
    public int calculate() {
        return super.getX() * super.getY() * this.getZ();
    }
}*/
//class people {
//    public int age;
//
//    public people(int age) {
//        this.age = age;
//    }
//}
//class animal extends people{
//    public String name;
//
//    public animal(String name) {
//        super(12);
//        this.name = name;
//        System.out.println("xx");
//    }
//}
//class dog extends animal {
//    public String color;
//
//    public dog(String name, String color) {
//        super(name);
//
//        this.color = color;
//        System.out.println("hh");
//    }
//
//    public static void main(String[] args) {
//        dog d1 = new dog("hh","lv");
//    }
//}

/*
public class Test {
    public static void main(String[] args) {
      //  people a1 = new people();
       // people a2 = new animal("green");
       // people a3 = new dog("wc","blue");
        dog a4 = new dog("小黄","black");


      */
/*  a3.age = 1;
        System.out.println(a1.age);
*//*

    }

}
*/

/*
class Base {
    Base() {
        System.out.print("Base");
    }
}

public class Test extends Base {

    public static void main( String[] args ) {
        new Test();//1
        //调用父类无参的构造方法
        new Base();//2
    }
}*/

/*
class X{
    Y y=new Y();//1
    public X(){//2
        System.out.print("X");
    }
}
class Y{
    public Y(){//3
        System.out.print("Y");
    }
}
public class Test extends X{
    Y y=new Y();//4
    public Test(){//5
        System.out.print("Z");
    }
    public static void main(String[] args) {
        new Test();
    }
}
*/
